package com.china.api.wechat;

import java.net.InetSocketAddress;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executors;

import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.china.api.wechat.server.HttpSnoopServerPipelineFactory;

public class Bootstrap {
	private static final Logger log = LoggerFactory.getLogger(Bootstrap.class);
	private static final int SERVER_PORT = 80;
	
	public static void main(String[] args) throws Exception {
		log.info("starting...");
 	    initCache();
		ServerBootstrap bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()));
		bootstrap.setOption("child.tcpNoDelay", true);
		bootstrap.setPipelineFactory(new HttpSnoopServerPipelineFactory());
		bootstrap.bind(new InetSocketAddress(SERVER_PORT));
		log.info("Server Started");
		
	}

	private static void initCache() {
		// TODO Auto-generated method stub
		
	}


}
